﻿<Markdown @ref="MarkdownElement" />

<div class="mt-3">
    <textarea class="form-control" rows="6" disabled="disabled">
            @MarkdownString
        </textarea>
</div>
<div class="mt-3">
    <textarea class="form-control" rows="6" disabled="disabled">
            @HtmlString        
        </textarea>
</div>

@code {
    private string? MarkdownString { get; set; }

    private string? HtmlString { get; set; }

    private MarkdownBase? MarkdownElement { get; set; }

    private async Task GetMarkdownString()
    {
        if (MarkdownElement != null) MarkdownString = await MarkdownElement.GetMarkdownString();
    }

    private async Task GetHTMLString()
    {
        if (MarkdownElement != null) HtmlString = await MarkdownElement.GetMarkdownHtmlString();
    }
}
